package com.acoffee.java;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.FileSystemResource;

/**
 * @author acoffee
 * @create 2021-11-10 12:12
 */
public class BeanfactoryDemo {
    public static void main(String[] args) {
        BeanFactory BeanFactory = new XmlBeanFactory(new FileSystemResource("D:\\code\\java-git-demo\\day1_spring\\src\\com\\acoffee\\java\\applicationContext.xml"));//文件系统中寻找指定的XML配置文件
        Person person = (Person) BeanFactory.getBean("chinese");
        person.eat();
    }
}
